﻿namespace KinonekoSoftware.Foundation.UI.Controls.Containers
{
#if AVALONIA
    
    using Avalonia.Media;
    using Avalonia.Controls.Templates;
    
    /// <summary>
    /// 
    /// </summary>
    public partial class SectionBase
    {

        public static readonly StyledProperty<bool> EnableQAProperty;

        static SectionBase()
        {
            EnableQAProperty           = AvaloniaProperty.Register<SectionBase, bool>(nameof(EnableQA));
            TitleProperty              = AvaloniaProperty.Register<SectionBase, object>(nameof(Title));
            TitleTemplateProperty      = AvaloniaProperty.Register<SectionBase, IDataTemplate>(nameof(TitleTemplate));
            TitleBrushProperty         = AvaloniaProperty.Register<SectionBase, Brush>(nameof(TitleBrush));
            TitlePaddingProperty       = AvaloniaProperty.Register<SectionBase, Thickness>(nameof(TitlePadding));
            TitleFontSizeProperty      = AvaloniaProperty.Register<SectionBase, int>(nameof(TitleFontSize));
            TitleFontFamilyProperty    = AvaloniaProperty.Register<SectionBase, FontFamily>(nameof(TitleFontFamily));
            ToolBarProperty            = AvaloniaProperty.Register<SectionBase, object>(nameof(ToolBar));
            ToolBarTemplateProperty    = AvaloniaProperty.Register<SectionBase, IDataTemplate>(nameof(ToolBarTemplate));
            SubTitleProperty           = AvaloniaProperty.Register<SectionBase, object>(nameof(SubTitle));
            SubTitleTemplateProperty   = AvaloniaProperty.Register<SectionBase, IDataTemplate>(nameof(SubTitleTemplate));
            SubTitleBrushProperty      = AvaloniaProperty.Register<SectionBase, Brush>(nameof(SubTitleBrush));
            SubTitlePaddingProperty    = AvaloniaProperty.Register<SectionBase, Thickness>(nameof(SubTitlePadding));
            SubTitleFontSizeProperty   = AvaloniaProperty.Register<SectionBase, int>(nameof(SubTitleFontSize));
            SubTitleFontFamilyProperty = AvaloniaProperty.Register<SectionBase, FontFamily>(nameof(SubTitleFontFamily));

        }

        #region Title

        public static readonly StyledProperty<object>               TitleProperty;
        public static readonly StyledProperty<IDataTemplate> TitleTemplateProperty;
        public static readonly StyledProperty<Brush>                TitleBrushProperty;
        public static readonly StyledProperty<Thickness>            TitlePaddingProperty;
        public static readonly StyledProperty<int>                  TitleFontSizeProperty;
        public static readonly StyledProperty<FontFamily>           TitleFontFamilyProperty;


        public FontFamily TitleFontFamily
        {
            get => GetValue(TitleFontFamilyProperty);
            set => SetValue(TitleFontFamilyProperty, value);
        }

        public int TitleFontSize
        {
            get => GetValue(TitleFontSizeProperty);
            set => SetValue(TitleFontSizeProperty, value);
        }

        public Thickness TitlePadding
        {
            get => GetValue(TitlePaddingProperty);
            set => SetValue(TitlePaddingProperty, value);
        }

        public Brush TitleBrush
        {
            get => GetValue(TitleBrushProperty);
            set => SetValue(TitleBrushProperty, value);
        }

        /// <summary>
        /// 获取或设置 <see cref="TitleTemplate"/> 属性。
        /// </summary>
        public IDataTemplate TitleTemplate
        {
            get => GetValue(TitleTemplateProperty);
            set => SetValue(TitleTemplateProperty, value);
        }

        /// <summary>
        /// 获取或设置 <see cref="Title"/> 属性。
        /// </summary>
        public object Title
        {
            get => GetValue(TitleProperty);
            set => SetValue(TitleProperty, value);
        }

        #endregion

        #region SubTitle

        public static readonly StyledProperty<object>               SubTitleProperty;
        public static readonly StyledProperty<IDataTemplate> SubTitleTemplateProperty;
        public static readonly StyledProperty<Brush>                SubTitleBrushProperty;
        public static readonly StyledProperty<Thickness>            SubTitlePaddingProperty;
        public static readonly StyledProperty<int>                  SubTitleFontSizeProperty;
        public static readonly StyledProperty<FontFamily>           SubTitleFontFamilyProperty;


        public FontFamily SubTitleFontFamily
        {
            get => GetValue(SubTitleFontFamilyProperty);
            set => SetValue(SubTitleFontFamilyProperty, value);
        }

        public int SubTitleFontSize
        {
            get => GetValue(SubTitleFontSizeProperty);
            set => SetValue(SubTitleFontSizeProperty, value);
        }

        public Thickness SubTitlePadding
        {
            get => GetValue(SubTitlePaddingProperty);
            set => SetValue(SubTitlePaddingProperty, value);
        }

        public Brush SubTitleBrush
        {
            get => GetValue(SubTitleBrushProperty);
            set => SetValue(SubTitleBrushProperty, value);
        }

        /// <summary>
        /// 获取或设置 <see cref="SubTitleTemplate"/> 属性。
        /// </summary>
        public IDataTemplate SubTitleTemplate
        {
            get => GetValue(SubTitleTemplateProperty);
            set => SetValue(SubTitleTemplateProperty, value);
        }

        /// <summary>
        /// 获取或设置 <see cref="SubTitle"/> 属性。
        /// </summary>
        public object SubTitle
        {
            get => GetValue(SubTitleProperty);
            set => SetValue(SubTitleProperty, value);
        }

        #endregion

        #region ToolBar

        /// <summary>
        /// 实现 <see cref="ToolBar"/> 属性的依赖属性。
        /// </summary>
        public static readonly StyledProperty<object> ToolBarProperty;

        /// <summary>
        /// 实现 <see cref="ToolBarTemplate"/> 属性的依赖属性。
        /// </summary>
        public static readonly StyledProperty<IDataTemplate> ToolBarTemplateProperty;


        /// <summary>
        /// 获取或设置 <see cref="ToolBarTemplate"/> 属性。
        /// </summary>
        public IDataTemplate ToolBarTemplate
        {
            get => GetValue(ToolBarTemplateProperty);
            set => SetValue(ToolBarTemplateProperty, value);
        }

        /// <summary>
        /// 获取或设置 <see cref="ToolBar"/> 属性。
        /// </summary>
        public object ToolBar
        {
            get => GetValue(ToolBarProperty);
            set => SetValue(ToolBarProperty, value);
        }

        #endregion

        public bool EnableQA
        {
            get => GetValue(EnableQAProperty);
            set => SetValue(EnableQAProperty, value);
        }
    }
#endif
}